<?php
if (!$_GET['id']) {
	die("请不要乱提交数据");
} else {
	$id = $_GET['id'];
	if(!is_numeric($id)){
		die("请不要乱提交数据");
	}
	require_once ("./includes/configure.php");
	require_once ("./includes/database.php");
	$db = Database :: Connect();
	$db->Execute("update qiuzu_qiugou set liulancishu=liulancishu+1 where this_id=$id");
/*
	$sql = "select A.*,quyu1.`value` as quyuA,quyu2.`value` as quyuB 
			from qiuzu_qiugou A,configuration quyu1,configuration quyu2
			where A.this_id=$id
			and quyu1.`key`='zufang_quyu'
			and quyu2.`key`='zufang_shangquan'
			and A.quyu=quyu1.this_id
			and A.quyu2=quyu2.this_id";
*/
	$sql = "select A.* from qiuzu_qiugou A where A.this_id=$id";
	$row = $db->GetSingleRow($sql);
	if($row->this_id==''){
		die("没有你要查看的房源信息,可能信息也被删除");
	}
	$qy1 = "select * from configuration where `key`='zufang_quyu' and this_id = ".$row->quyu;
	$rowqy1 = $db->GetSingleRow($qy1);
	$quyuA = $rowqy1->value;
	$qy2 = "select * from configuration where `key`='zufang_shangquan' and this_id = ".$row->quyu2;
	$rowqy2 = $db->GetSingleRow($qy2);
	$quyuB = $rowqy2->value;
?>
<style>
	.caozuo1 {
		padding: 15px 10px 20px;
	}
	.caozuo1 a:link, .caozuo a:visited {
		text-decoration: none;
	}
	.caozuo1 a {
		margin-right: 15px;
	}
	.qiuzu_qiugou_detail{
		padding:20px;
	}
	.qiuzu_qiugou_detail h1{
		display: inline;
		font: 25px "微软雅黑","黑体",sans-serif;
		margin: 0 0 0 10px;
		color:#000;
	}
	.other{
		bottom: 15px;
		color: #585858;
		font-size: 12px;
		position: absolute;
		right: 10px;
	}
	.info {
		display: block;
		float: left;
		padding: 35px 0 0 10px;
		width: 380px;
	}
	.user {
		border-left: 1px solid #CCCCCC;
		float: right;
		margin-top: 35px;
		padding: 0 0 0 40px;
		width: 460px;
	}
	.info li {
		padding-bottom: 20px;
	}
	ol, ul {
		list-style: none outside none;
	}
	.info li i {
		color: #585858;
		display: inline-block;
		font-style: normal;
		width: 45px;
	}
	.redfont {
		color: #FF0000;
		font: bold 14px verdana,sans-serif;
	}
	.userinfo li {
		padding-bottom: 20px;
	}
	.userinfo li i {
		color: #585858;
		display: inline-block;
		font-style: normal;
		padding-right: 1px;
		text-align: right;
		width: 70px;
	}
	.medium {
		background: url("detail.png") repeat scroll -117px -60px #FF8800;
		color: #FFFFFF;
		display: inline-block;
		font-size: 12px;
		font-style: normal;
		height: 14px;
		line-height: 14px;
		margin-left: 5px;
		text-align: center;
		width: 50px;
	}
</style>
	<div class="qiuzu_qiugou_detail">
		<div style="border-bottom:solid; border-bottom: 1px solid #CCCCCC;padding-bottom:10px; position: relative;">
			<h1><?php 
					if($row->qiuzu_qiugou=='1'){echo '[求租] ';}else{echo '[求购] ';}
					echo $row->biaoti;
				?></h1>
			<div class="other">
				发布时间：<?php echo date("Y-m-d",strtotime($row->fabushijian));?>　
				浏览<em id="totalcount"><?php echo $row->liulancishu;?></em>次　
			</div>
		</div>
		<div class="w" style=" font-size: 14px;border-bottom: 1px solid #CCCCCC;">
			<ul class="info">
				<?php if($row->qiuzu_qiugou=='1'){?>
					<li><i>区域：</i><?php echo $quyuA;?> <?php echo $quyuB;?></li> 
					<li><i>租金：</i><?php echo $row->zujin_goujia;?>元/月</li>
				<?php }else if($row->qiuzu_qiugou=='2'){?>
					<li><i>价格：</i><em class="redfont"><?php echo $row->zujin_goujia;?></em> 万元</li> 
					<li><i>面积：</i><?php echo $row->mianji;?>㎡</li>
					<?php $chanquan = $db->GetSingleRow("select * from configuration where `key`='qiugou_chanquan' and `value`=".$row->qiugou_chanquan);?>
					<li><i>产权：</i><?php echo $chanquan->C;?></li>
					<?php $fangxing = $db->GetSingleRow("select * from configuration where `key`='zufang_fangxing' and `value`=".$row->fangxing);?>
					<li><i>户型：</i><?php echo $fangxing->C;?></li>
					<li><i>区域：</i><?php echo $quyuA;?> <?php echo $quyuB;?></li>
				<?php }?>
			</ul>
			<div class="user">
				<div id="newuser"><ul class="userinfo">
					<li><i>联&nbsp;&nbsp;系&nbsp;&nbsp;人：</i>
					<?php 
						echo $row->lianxiren;
						if($row->geren_jingjiren){
							echo '<em class="medium">经纪人</em>';
						}
					?>
					</li>
					</ul>
				</div>				
				<ul class="vuser nomargin">
					<li class="call_2">
						<i>联系电话：</i>
						<?php echo $row->lianxidianhua;?>
					</li>
				</ul>			
			</div>
			<div class="clear"></div>
		</div>
		<div style="line-height: 2;margin-bottom: 5px;margin-top: 25px;padding: 0 10px;">
			<?php echo $row->xiangximiaoshu1;?>
			<div class="caozuo1">
				
			</div>
		</div>
	</div>
<?php
	$db->Close();
}
?>